package com.gxa.order.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

import lombok.Data;

/**
 * 服务订单表
 * @TableName service_order
 */
@TableName(value ="service_order")
@Data
public class ServiceOrder implements Serializable {
    /**
     * 主键ID
     */
    @TableId
    private Long id;

    /**
     * 订单号
     */
    private Long orderNumber;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 服务ID
     */
    private Long serviceId;

    /**
     * 房产ID
     */
    private Long houseId;

    /**
     * 服务进度
     */
    private Integer progress;

    /**
     * 订单金额
     */
    private Integer money;

    /**
     * 下单时间
     */
    private Date orderTime;

    /**
     * 订单状态（0 待支付，1 服务中，2 已完成，3 已取消，4 暂停服务，5 待沟通，6 沟通中）
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 删除位（假删除）
     */
    private Integer isDeleted;
    /**
     * 评论Id
     */
    private  Integer commentId;
    /**
     * 客户线下评论
     */
    private Integer userProofId;
    /**
     * 工作人员线下评论
     */
    private Integer workProofId;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ServiceOrder that = (ServiceOrder) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (orderNumber != null ? !orderNumber.equals(that.orderNumber) : that.orderNumber != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (serviceId != null ? !serviceId.equals(that.serviceId) : that.serviceId != null) return false;
        if (houseId != null ? !houseId.equals(that.houseId) : that.houseId != null) return false;
        if (progress != null ? !progress.equals(that.progress) : that.progress != null) return false;
        if (money != null ? !money.equals(that.money) : that.money != null) return false;
        if (orderTime != null ? !orderTime.equals(that.orderTime) : that.orderTime != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;
        if (isDeleted != null ? !isDeleted.equals(that.isDeleted) : that.isDeleted != null) return false;
        if (commentId != null ? !commentId.equals(that.commentId) : that.commentId != null) return false;
        if (userProofId != null ? !userProofId.equals(that.userProofId) : that.userProofId != null) return false;
        return workProofId != null ? workProofId.equals(that.workProofId) : that.workProofId == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (orderNumber != null ? orderNumber.hashCode() : 0);
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (serviceId != null ? serviceId.hashCode() : 0);
        result = 31 * result + (houseId != null ? houseId.hashCode() : 0);
        result = 31 * result + (progress != null ? progress.hashCode() : 0);
        result = 31 * result + (money != null ? money.hashCode() : 0);
        result = 31 * result + (orderTime != null ? orderTime.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (isDeleted != null ? isDeleted.hashCode() : 0);
        result = 31 * result + (commentId != null ? commentId.hashCode() : 0);
        result = 31 * result + (userProofId != null ? userProofId.hashCode() : 0);
        result = 31 * result + (workProofId != null ? workProofId.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "ServiceOrder{" +
                "id=" + id +
                ", orderNumber=" + orderNumber +
                ", userId=" + userId +
                ", serviceId=" + serviceId +
                ", houseId=" + houseId +
                ", progress=" + progress +
                ", money=" + money +
                ", orderTime=" + orderTime +
                ", status=" + status +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", isDeleted=" + isDeleted +
                ", commentId=" + commentId +
                ", userProofId=" + userProofId +
                ", workProofId=" + workProofId +
                '}';
    }
}